/**
 * Copyright (C) 2010 David Simonek <dafesimonek@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ConcertActionsPanel.java
 *
 * Created on Aug 6, 2010, 9:38:11 PM
 */

package org.dafe.partyband.gui.concerts;

import javax.swing.Action;
import org.dafe.partyband.db.api.IConcert;
import org.dafe.partyband.gui.songs.ActionsFactory;
import org.openide.util.NbBundle;

/**
 *
 * @author dafe
 */
public class ConcertActionsPanel extends javax.swing.JPanel {
    private final Action moveUpAction;
    private final Action moveDownAction;
    private final Action addAction;
    private final Action openTextAction;
    private final Action playMp3Action;
    private final Action exportAction;

    /** Creates new form ConcertActionsPanel */
    public ConcertActionsPanel(IConcert concert, PlaylistPanel playlistPanel) {
        initComponents();

        addAction = ConcertActionsFactory.createAddAction(concert, playlistPanel);
        modificationsPane.add(addAction);
        
        moveUpAction = ConcertActionsFactory.createMoveSongAction(
                NbBundle.getMessage(ConcertActionsPanel.class, "ACT_MoveUp"),
                NbBundle.getMessage(ConcertActionsPanel.class, "HINT_MoveUp"),
                concert, playlistPanel, playlistPanel.getSelSongLookup(), -1);
        modificationsPane.add(moveUpAction);

        moveDownAction = ConcertActionsFactory.createMoveSongAction(
                NbBundle.getMessage(ConcertActionsPanel.class, "ACT_MoveDown"),
                NbBundle.getMessage(ConcertActionsPanel.class, "HINT_MoveDown"),
                concert, playlistPanel, playlistPanel.getSelSongLookup(), 1);
        modificationsPane.add(moveDownAction);

        modificationsPane.add(ConcertActionsFactory.createDeleteSongAction(
                concert, playlistPanel, playlistPanel.getSelSongLookup()));

        songsPane.add(ActionsFactory.createPrintMaterialsAction(
                playlistPanel.getSelSongTextsLookup(),
                NbBundle.getMessage(ConcertActionsPanel.class, "ACT_PrintSelected"),
                NbBundle.getMessage(ConcertActionsPanel.class, "HINT_PrintSelected")));
        songsPane.add(ConcertActionsFactory.createPrintPlaylistAction(concert, playlistPanel));
        openTextAction = ActionsFactory.createOpenTextSongAction(playlistPanel.getSelSongLookup());
        songsPane.add(openTextAction);
        playMp3Action = ActionsFactory.createPlayMp3SongAction(playlistPanel.getSelSongLookup());
        songsPane.add(playMp3Action);
        exportAction = ConcertActionsFactory.createExportSongAction(playlistPanel.getSelResourcesLookup());
        songsPane.add(exportAction);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jXTaskPaneContainer1 = new org.jdesktop.swingx.JXTaskPaneContainer();
        modificationsPane = new org.jdesktop.swingx.JXTaskPane();
        songsPane = new org.jdesktop.swingx.JXTaskPane();
        informationPane = new org.jdesktop.swingx.JXTaskPane();
        legendPane = new org.jdesktop.swingx.JXTaskPane();

        modificationsPane.setTitle(org.openide.util.NbBundle.getMessage(ConcertActionsPanel.class, "ConcertActionsPanel.modificationsPane.title", new Object[] {})); // NOI18N
        jXTaskPaneContainer1.add(modificationsPane);

        songsPane.setTitle(org.openide.util.NbBundle.getMessage(ConcertActionsPanel.class, "ConcertActionsPanel.songsPane.title", new Object[] {})); // NOI18N
        jXTaskPaneContainer1.add(songsPane);

        informationPane.setTitle(org.openide.util.NbBundle.getMessage(ConcertActionsPanel.class, "ConcertActionsPanel.informationPane.title", new Object[] {})); // NOI18N
        jXTaskPaneContainer1.add(informationPane);

        legendPane.setTitle(org.openide.util.NbBundle.getMessage(ConcertActionsPanel.class, "ConcertActionsPanel.legendPane.title", new Object[] {})); // NOI18N
        jXTaskPaneContainer1.add(legendPane);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jXTaskPaneContainer1, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jXTaskPaneContainer1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.jdesktop.swingx.JXTaskPane informationPane;
    private org.jdesktop.swingx.JXTaskPaneContainer jXTaskPaneContainer1;
    private org.jdesktop.swingx.JXTaskPane legendPane;
    private org.jdesktop.swingx.JXTaskPane modificationsPane;
    private org.jdesktop.swingx.JXTaskPane songsPane;
    // End of variables declaration//GEN-END:variables

}
